<p>This rule raises an issue when <code>Promise.all()</code>, <code>Promise.any()</code>, or <code>Promise.race()</code> is called with an array
containing exactly one element.</p>
<h2>Why is this an issue?</h2>
<p>Passing single-element arrays to Promise methods like <code>Promise.all()</code>, <code>Promise.any()</code>, or <code>Promise.race()</code> is
usually a mistake that adds unnecessary complexity.</p>
<p>These methods are designed to handle multiple asynchronous operations concurrently. When you pass a single-element array, you’re not taking
advantage of their core functionality - coordinating multiple promises.</p>
<p>For example, <code>Promise.all([singlePromise])</code> does the same thing as just awaiting <code>singlePromise</code> directly, but with extra
overhead and less readable code. The array wrapper serves no purpose and can confuse other developers about your intentions.</p>
<p>This pattern often appears when:</p>
<ul>
  <li> Code originally handled multiple promises but was later simplified </li>
  <li> Developers misunderstand how Promise methods work </li>
  <li> Copy-paste errors introduce unnecessary array wrapping </li>
</ul>
<p>Using the promise directly makes your code cleaner, more performant, and clearer about your actual intent.</p>
<h3>What is the potential impact?</h3>
<p>This issue reduces code readability and adds unnecessary complexity. While it doesn’t cause runtime errors, it can confuse other developers and
indicates a misunderstanding of Promise APIs. The extra array allocation and method call also create minor performance overhead.</p>
<h3>How to fix?</h3>
<p>Remove the array wrapper and await the promise directly. This is cleaner and more efficient than using Promise methods with single elements.</p>
<h4>Non-compliant code example</h4>
<pre data-diff-id="1" data-diff-type="noncompliant">
const result = await Promise.all([promise]); // Noncompliant
</pre>
<h4>Compliant code example</h4>
<pre data-diff-id="1" data-diff-type="compliant">
const result = await promise;
</pre>
<h3>Documentation</h3>
<ul>
  <li> <a href="https://github.com/sindresorhus/eslint-plugin-unicorn#readme">eslint-plugin-unicorn</a> - Rule <a
  href="https://github.com/sindresorhus/eslint-plugin-unicorn/blob/HEAD/docs/rules/no-single-promise-in-promise-methods.md">no-single-promise-in-promise-methods</a> </li>
  <li> MDN - Promise.all() - <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/all">Documentation for
  Promise.all() method and its proper usage</a> </li>
  <li> MDN - Promise.race() - <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/race">Documentation
  for Promise.race() method and when to use it</a> </li>
  <li> MDN - Promise.any() - <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/any">Documentation for
  Promise.any() method and its use cases</a> </li>
</ul>
